package com.ruoyi.kycinfo.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.kycinfo.mapper.GrantRecordMapper;
import com.ruoyi.kycinfo.domain.GrantRecord;
import com.ruoyi.kycinfo.service.IGrantRecordService;

/**
 * 营销宣传品发放记录
 Service业务层处理
 *
 * @author wzk
 * @date 2023-10-02
 */
@Service
public class GrantRecordServiceImpl implements IGrantRecordService
{
    @Autowired
    private GrantRecordMapper grantRecordMapper;

    /**
     * 查询营销宣传品发放记录

     *
     * @param id 营销宣传品发放记录
    主键
     * @return 营销宣传品发放记录

     */
    @Override
    public GrantRecord selectGrantRecordById(Long id)
    {
        return grantRecordMapper.selectGrantRecordById(id);
    }

    /**
     * 查询营销宣传品发放记录
     列表
     *
     * @param grantRecord 营销宣传品发放记录

     * @return 营销宣传品发放记录

     */
    @Override
    public List<GrantRecord> selectGrantRecordList(GrantRecord grantRecord)
    {
        return grantRecordMapper.selectGrantRecordList(grantRecord);
    }

    /**
     * 新增营销宣传品发放记录

     *
     * @param grantRecord 营销宣传品发放记录

     * @return 结果
     */
    @Override
    public int insertGrantRecord(GrantRecord grantRecord)
    {
        grantRecord.setCreateTime(DateUtils.getNowDate());
        return grantRecordMapper.insertGrantRecord(grantRecord);
    }

    /**
     * 修改营销宣传品发放记录

     *
     * @param grantRecord 营销宣传品发放记录

     * @return 结果
     */
    @Override
    public int updateGrantRecord(GrantRecord grantRecord)
    {
        grantRecord.setUpdateTime(DateUtils.getNowDate());
        return grantRecordMapper.updateGrantRecord(grantRecord);
    }

    /**
     * 批量删除营销宣传品发放记录

     *
     * @param ids 需要删除的营销宣传品发放记录
    主键
     * @return 结果
     */
    @Override
    public int deleteGrantRecordByIds(Long[] ids)
    {
        return grantRecordMapper.deleteGrantRecordByIds(ids);
    }

    /**
     * 删除营销宣传品发放记录
     信息
     *
     * @param id 营销宣传品发放记录
    主键
     * @return 结果
     */
    @Override
    public int deleteGrantRecordById(Long id)
    {
        return grantRecordMapper.deleteGrantRecordById(id);
    }
}
